home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 216_01 / sz.1 < prev    next >
Encoding:
Text File  |  1980-01-01  |  10.3 KB  |  400 lines

  1. '\" Revision Level 
  2. '\" Last Delta     01-01-87
  3. .TH SZ 1 OMEN
  4. .SH NAME
  5. sz \- XMODEM, YMODEM, ZMODEM Batch file Send
  6. .SH SYNOPSIS
  7. sz
  8. .RB [\- +1abdefkLlNnpqTtuvy ]
  9. .I file ...
  10. .br
  11. sz -X
  12. .RB [\- 1kqtuv ]
  13. .I file
  14. .br
  15. sz
  16. .RB [\- 1qtv ]
  17. .B "-c COMMAND"
  18. .br
  19. sz
  20. .RB [\- 1qtv ]
  21. .B "-i COMMAND"
  22. .SH DESCRIPTION
  23. .B Sz
  24. uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
  25. one or more files over a serial port to a variety of programs running under
  26. PC-DOS, CP/M, Unix, VMS, and other operating systems.
  27.  
  28.  
  29. The first form of
  30. .B sz
  31. sends one or more files with ZMODEM or YMODEM batch protocol.
  32. Normally, only the file name part of the pathname is transmitted.
  33. On
  34. .SM Unix
  35. systems, additional information about the file is transmitted.
  36. If the receiving program uses this information,
  37. the transmitted file length controls the exact number of bytes written to
  38. the output dataset,
  39. and the modify time and file mode
  40. are set accordingly.
  41.  
  42. Output from another program may be piped to
  43. .B sz
  44. for transmission by specifying the
  45. .B -1
  46. option and denoting standard input by "-":
  47. .ce
  48. ps -ef | sz -
  49. The program output is transmitted with the filename sPID.sz
  50. where PID is the process ID of the
  51. .B sz
  52. program.
  53. If the environment variable
  54. .B ONAME
  55. is set, that is used instead.
  56. In this case, the Unix command:
  57. .ce
  58. ONAME=con ps -ef|sz -ay -
  59. will send a "file" to the PC-DOS console display.
  60. The
  61. .B -y
  62. option instructs the receiver to open the file for writing unconditionally.
  63. The
  64. .B -a
  65. option
  66. causes the receiver to convert Unix newlines to PC-DOS carriage returns
  67. and linefeeds.
  68.  
  69. Unix
  70. .B sz
  71. supports
  72. .B YMODEM-g
  73. with "cbreak" tty mode, XON/XOFF flow control,
  74. and the interrupt character set to CAN.
  75. .B YMODEM-g
  76. (Professional-YAM
  77. .B g
  78. option)
  79. increases throughput over error free channels
  80. (direct connection, X.PC, etc.)
  81. by not acknowledging each transmitted sector.
  82.  
  83.  
  84. The second form of
  85. .B sz
  86. uses the
  87. .B -X
  88. flag to send a single
  89. .I file
  90. with
  91. .B XMODEM
  92. or
  93. .B XMODEM-1k
  94. protocol.
  95. The user must supply the file name to both sending and receiving programs.
  96.  
  97. Iff
  98. .B sz
  99. is invoked with $SHELL set and iff that variable contains the
  100. string
  101. .I "rsh"
  102. or
  103. .I "rksh"
  104. (restricted shell), sz operates in restricted mode.
  105. Restricted mode restricts pathnames to the current directory and
  106. PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
  107. thereof.
  108.  
  109.  
  110. The third form sends a single COMMAND to the receiver for execution.
  111. .B Sz
  112. exits with the COMMAND return value.
  113. If COMMAND includes spaces or characters special to the shell,
  114. it must be quoted.
  115.  
  116. The fourth form sends a single COMMAND to the receiver for execution.
  117. .B Sz
  118. exits as soon as the receiver has correctly received the command,
  119. before it is executed.
  120.  
  121.  
  122. If sz is invoked with stdout and stderr to different datasets,
  123. Verbose is set to 2, causing frame by frame progress reports
  124. to stderr.
  125. This may be disabled with the
  126. .B q
  127. option.
  128. .PP
  129. The meanings of the available options are:
  130. .PP
  131. .PD 0
  132. .TP
  133. .B +
  134. Instruct the receiver to append transmitted data to an existing file
  135. (ZMODEM only).
  136. .TP
  137. .B 1
  138. Use file descriptor 1 for ioctls and reads (Unix only).
  139. By default, file descriptor 0 is used.
  140. This option allows
  141. .B sz
  142. to be used with the
  143. .I cu
  144. ~$
  145. command.
  146. If the calling program has spawned a separate process to
  147. read characters from the modem,
  148. that process 
  149. must be disabled for
  150. .I rz
  151. to operate properly.
  152. .TP
  153. .B a
  154. Convert NL characters in the transmitted file to CR/LF.
  155. This is done by the sender for XMODEM and YMODEM, by the receiver
  156. for ZMODEM.
  157. .TP
  158. .B b
  159. (ZMODEM) Binary override: transfer file without any translation.
  160. .TP
  161. .B "c COMMAND"
  162. Send COMMAND to the receiver for execution, return with COMMAND\'s exit status.
  163. .TP
  164. .B d
  165. Change all instances of "." to "/" in the transmitted pathname.
  166. Thus, C.omenB0000 (which is unacceptable to MSDOS or CP/M)
  167. is transmitted as C/omenB0000.
  168. If the resultant filename has more than 8 characters in the stem,
  169. a "." is inserted to allow a total of eleven.
  170. .TP
  171. .B E
  172. Escape only Ctrl-X control characters;
  173. normally XON, XOFF, CR-@-CR, and Ctrl-X are escaped.
  174. .TP
  175. .B e
  176. Escape all control characters;
  177. normally XON, XOFF, CR-@-CR, and Ctrl-X are escaped.
  178. .TP
  179. .B f
  180. Send Full pathname.
  181. Normally directory prefixes are stripped from the transmitted
  182. filename.
  183. .TP
  184. .B "i COMMAND"
  185. Send COMMAND to the receiver for execution, return Immediately
  186. upon the receiving program's successful recption of the command.
  187. .TP
  188. .B k
  189. (XMODEM/YMODEM) Send files using 1024 byte blocks
  190. rather than the default 128 byte blocks.
  191. 1024 byte packets speed file transfers at high bit rates.
  192. (ZMODEM streams the data for the best possible throughput.)
  193. .TP
  194. .B "L N"
  195. Use ZMODEM sub-packets of length N.
  196. A larger N (32 <= N <= 1024) gives slightly higher throughput,
  197. a smaller N speeds error recovery.
  198. The default is 128 below 300 baud, 256 above 300 baud, or 1024 above 2400 baud.
  199. .TP
  200. .B "l N"
  201. Wait for the receiver to acknowledge correct data every
  202. .B N
  203. (32 <= N <= 1024)
  204. characters.
  205. This may be used to avoid network overrun when XOFF flow control is lacking.
  206. .TP
  207. .B n
  208. (ZMODEM) Send each file if
  209. destination file does not exist.
  210. Overwrite destination file if
  211. source file is newer or longer than the destination file.
  212. .TP
  213. .B N
  214. (ZMODEM) Send each file if
  215. destination file does not exist.
  216. Overwrite destination file if
  217. source file has different length or date.
  218. .TP
  219. .B p
  220. (ZMODEM) Protect existing destination files by skipping transfer if the
  221. destination file exists.
  222. .TP
  223. .B q
  224. Quiet suppresses verbosity.
  225. .TP
  226. .B r
  227. Resume interrupted file transfer.
  228. If the source file is longer than the destination file,
  229. the transfer commences at the offset in the source file that equals
  230. the length of the destination file.
  231. .TP
  232. .B "t tim"
  233. Change timeout to
  234. .I tim
  235. tenths of seconds.
  236. .TP
  237. .B u
  238. Unlink the file after successful transmission.
  239. .TP
  240. .B v
  241. Verbose
  242. causes a list of file
  243. names to be appended to
  244. /tmp/szlog .
  245. More v's generate more output.
  246. .TP
  247. .B X
  248. Send a single file with
  249. .B XMODEM
  250. or
  251. .B XMODEM-1k
  252. protocol.
  253. .TP
  254. .B y
  255. Instruct a ZMODEM receiving program to overwrite any existing file
  256. with the same name.
  257. .PD
  258. .SH EXAMPLES
  259. .ne 7
  260. .B "ZMODEM File Transfer"
  261. .br
  262. .B "$ sz -a *.c"
  263. .br
  264. This single command transfers all .c files in the current Unix directory
  265. with conversion
  266. .RB ( -a )
  267. to end of line conventions appropriate to the receiving environment.
  268. With ZMODEM AutoDownload enabled, Professional-YAM automatically recieves
  269. the files after performing a security challenge.
  270.  
  271. .B "ZMODEM Command Download"
  272. .br
  273.  cpszall:all
  274.     sz -c "c:;cd /yam/dist"
  275.     sz -ya $(YD)/*.me
  276.     sz -yqb y*.exe
  277.     sz -c "cd /yam"
  278.     sz -i "!insms"
  279. .br
  280. This Makefile fragment uses
  281. .B sz
  282. to issue commands to Professional-YAM to change current disk and directory.
  283. Next,
  284. .B sz
  285. transfers the
  286. .I .me
  287. files from the $YD directory, commanding the receiver to overwrite the old files
  288. and to convert from Unix end of line conventions to PC-DOS conventions.
  289. The third line transfers some
  290. .I .exe
  291. files.
  292. The fourth and fifth lines command Pro-YAM to
  293. change directory and execute a PC-DOS batch file
  294. .I insms .
  295. Since the batch file takes considerable time, the
  296. .B "-i"
  297. form is used to allow
  298. .B sz
  299. to exit immediately.
  300.  
  301. .B "XMODEM File Transfer"
  302. .br
  303. $
  304. .B "sz -Xa foo.c"
  305. .br
  306. .B "ESC"
  307. .br
  308. .B "rx foo.c"
  309. .br
  310. The above three commands transfer a single file
  311. from Unix to a PC and Crosstalk XVI 3.6,
  312. translating Unix newlines to DOS CR/LF.
  313.  
  314. .SH SEE ALSO
  315. rz(omen),
  316. ZMODEM.DOC,
  317. YMODEM.DOC,
  318. Professional-YAM manual,
  319. IMP(CP/M),
  320. cu(1),
  321. sq(omen),
  322. todos(omen),
  323. tocpm(omen),
  324. tomac(omen),
  325. yam(omen)
  326.  
  327. Compile time options required for various operating systems are described in
  328. the source file.
  329. .SH "VMS VERSION"
  330. The VMS version does not transmit the file date.
  331. The VMS version calculates the file length by reading the file
  332. and counting the bytes.
  333.  
  334. The VMS version does not support YMODEM-g or ZMODEM.
  335.  
  336. When VMS is lightly loaded, the response time may be too quick for MODEM7
  337. unless the MODEM7
  338. .B "q"
  339. modifier is used.
  340.  
  341. The VMS C standard i/o package and RMS sometimes interact to modify
  342. file contents unexpectedly.
  343. .SH FILES
  344. sz.c, rbsb.c, zm.c, zmodem.h source files
  345.  
  346. /tmp/szlog stores debugging output (sz -vv)
  347. .SH "TESTING FEATURE"
  348. The command "sz -T file"
  349. exercises the
  350. .B Attn
  351. sequence error recovery by commanding
  352. errors with unterminated packets.
  353. The receiving program should complain five times about
  354. binary data packets being too long.
  355. Each time
  356. .B sz
  357. is interrupted,
  358. it should send a ZDATA header followed by another defective packet.
  359. If the receiver does not detect five long data packets,
  360. the
  361. .B Attn
  362. sequence is not interrupting the sender, and the
  363. .B Myattn
  364. string in
  365. .B sz.c
  366. must be modified.
  367.  
  368. After 5 packets,
  369. .B sz
  370. stops the "transfer" and
  371. prints the total number of characters "sent" (Tcount).
  372. The difference between Tcount and 5120 represents the number of characters
  373. stored in various buffers when the Attn sequence is generated.
  374. .SH BUGS
  375. XMODEM transfers add up to 127 garbage bytes per file (1023 bytes with
  376. XMODEM-k).
  377. Most YMODEM programs use the file length transmitted at the beginning of the
  378. transfer to prune the file to the correct length; this may cause problems with
  379. source files that grow during the course of the transfer.
  380. This problem does not pertain to ZMODEM transfers, which preserve the exact
  381. file length unconditionally.
  382.  
  383. Most ZMODEM options are merely passed to the receiving program;
  384. some do not implement all these options.
  385.  
  386. Circular buffering and a ZMODEM sliding window should be used
  387. when input is from pipes instead of acknowledging frames each 1024 bytes.
  388. If no files can be opened,
  389. .B sz
  390. sends a ZMODEM command to echo a suitable complaint;
  391. perhaps it should check for the presence of at least one accessible file before
  392. getting hot and bothered.
  393. The test mode leaves a zero length file on the receiving system.
  394.  
  395. Some high speed modems have a firmware bug that drops characters when the
  396. direction of high speed transmissson is reversed.
  397. The environment variable ZNULLS may be used to specify the number of nulls to
  398. send before a ZDATA frame.
  399. Values of 101 for a 4.77 mHz PC and 124 for an AT are typical.
  400.